package com.jnu.hc.jnuhcdoccms.service;

import com.jnu.hc.jnuhcdoccms.dto.ResponseObject;
import com.jnu.hc.jnuhcdoccms.exception.HcAPPException;
import com.jnu.hc.jnuhcusercms.domain.Orders;
import com.jnu.hc.jnuhcusercms.mapper.OrdersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrdersMapper ordersMapper;
    @Override
    public ResponseObject getOrderList(){
        List<Orders> ordersList=ordersMapper.selectAllOrders();
        if(ordersList==null||ordersList.size()==0){
            throw new HcAPPException(1003,"未查询到任何订单");
        }
        return new ResponseObject(ResponseObject.SUCCESS_STATUS,ResponseObject.SUCCESS_DESC,ordersList);
    }
}
